﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/Administration.Master" AutoEventWireup="true" CodeBehind="CourseManagement.aspx.cs" Inherits="UnwiseSource.Administration.CourseManagement" %>
<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="main_body" runat="server">
    
    <link href="AStyles/courseManagement-style.css" rel="stylesheet" />
    <link href="AStyles/datepicker-styles.css" rel="stylesheet" />
    <div id="course_management_content_holder">
        <ajaxToolkit:ToolkitScriptManager ID="sm" runat="server"></ajaxToolkit:ToolkitScriptManager>
        <header id="courseManagement_header">
            <a href="CoursesTool.aspx" class="courseManagement_btn">Назад</a>
            <a href="#" runat="server" class="courseManagement_btn" id="btn_Save" onserverclick="btn_Save_Click"
                 onclick="javascript: return Validate();">Запази</a>

            <div id="alias_holder">
                <p>Псевдоним: </p>
                <p runat="server" id="p_course_alias" visible="false"></p>
                <input type="text" id="tb_courseAlias" maxlength="10" runat="server" visible="false"/>
            </div>
        </header>
        
        <div id="courseName_holder">
            <h2>Име на курс</h2>
            <ajaxToolkit:TabContainer ID="tc_courseName" runat="server" ScrollBars="None" >

                <ajaxToolkit:TabPanel ID="tab_courseNameBG" runat="server">
                    <HeaderTemplate >BG</HeaderTemplate>
                    <ContentTemplate>
                        <input type="text" id="tb_courseNameBG" runat="server"/>
                    </ContentTemplate>
                </ajaxToolkit:TabPanel>

                <ajaxToolkit:TabPanel  ID="tab_courseNameEN" runat="server">
                    <HeaderTemplate >EN</HeaderTemplate>
                    <ContentTemplate>
                        <input type="text" id="tb_courseNameEN" runat="server"/>
                    </ContentTemplate>
                </ajaxToolkit:TabPanel>
         
            </ajaxToolkit:TabContainer>
        </div>
         
         <div id="courseSummary_holder">
            <h2>Информация за курса</h2>
            <ajaxToolkit:TabContainer ID="tc_courseSummary" runat="server" ScrollBars="None" >

                <ajaxToolkit:TabPanel ID="tab_courseSummaryBG" runat="server">
                    <HeaderTemplate >BG</HeaderTemplate>
                    <ContentTemplate>
                        <textarea id="tb_courseSummaryBG" maxlength="250" runat="server"></textarea>
                    </ContentTemplate>
                </ajaxToolkit:TabPanel>

                <ajaxToolkit:TabPanel  ID="tab_courseSummaryEN" runat="server">
                    <HeaderTemplate >EN</HeaderTemplate>
                    <ContentTemplate>
                        <textarea id="tb_courseSummaryEN" maxlength="250" runat="server"></textarea>
                    </ContentTemplate>
                </ajaxToolkit:TabPanel>
         
            </ajaxToolkit:TabContainer>
        </div>

        <div id="afterTabs_holder">
            <asp:UpdatePanel runat="server" ID="ListPanel" UpdateMode="Conditional">
                <ContentTemplate>
                    <div id="list_holder">
                        <div runat="server" id="users_list_holder" visible="false">
                            <h1>Потребители:</h1>
                            <asp:ListBox ID="list_users" runat="server" SelectionMode="Multiple">
                                
                            </asp:ListBox>
                        </div>

                        <div runat="server" id="btns_ofLists_holder" visible="false">
                            <div id="listBtns_holder">
                                <asp:Button ID="btnAdd" runat="server" Text="Добави" CssClass="listBtns" OnClick="btnAdd_Click"/>
                                <asp:Button ID="btnRemove" runat="server" Text="Премахни" CssClass="listBtns" OnClick="btnRemove_Click"/>
                            </div>
                        </div>

                        <div runat="server" id="moderators_list_holder" visible="false">
                            <h1>Модератори:</h1>
                            <asp:ListBox ID="list_moderators" runat="server" SelectionMode="Multiple">

                            </asp:ListBox>
                        </div>

                        <div runat="server" id="lectors_list_holder" visible="false">
                            <div id="lectors_holder">
                                <h1>Лектори:</h1>
                                <div id="lectors_listHolder">
                                    <asp:CheckBoxList runat="server" ID="cbl_Lectors">

                                    </asp:CheckBoxList>
                                </div>
                            </div>
                        </div>
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnAdd" />
                    <asp:AsyncPostBackTrigger ControlID="btnRemove" />
                </Triggers>
            </asp:UpdatePanel>

            <div id="rightControls_holder">
                <div>
                    <label for="ddl_Levels">Ниво на сложност: </label>

                    <asp:DropDownList ID="ddl_Levels" runat="server">

                    </asp:DropDownList>
                </div>
                <div class="datepicker_holder">
                    <label for="dp_startDate">Начална дата:</label>
                    <%-- <eo:DatePicker runat="server" id="dp_startDate" DayCellWidth="22" DayCellHeight="14"
				            DisableWeekendDays="True" Width="100px">
				        <TitleTemplate>
					        <table width="100%" border="0" cellSpacing="0" cellPadding="0" style="background-color:#f3f3f3;font-size: 11px; font-family: verdana; ">
						        <tr>
							        <!-- Previous Year -->
							        <td>
								        <a href="javascript: void {var:this}.goTo(-12);" class="eo_calendar_style1_title_button">
									        <img src="{img:00040302}" border="0" /> </a>
							        </td>
							        <!-- Previous Month -->
							        <td>
								        <a href="javascript: void {var:this}.goTo(-1);" class="eo_calendar_style1_title_button">
									        <img src="{img:00040301}" border="0" /> </a>
							        </td>
							        <!-- Current Month -->
							        <td width="99%" align="center">
								        {var:visible_date:MMM - yy}
							        </td>
							        <!-- Next Month -->
							        <td>
								        <a href="javascript: void {var:this}.goTo(1);" class="eo_calendar_style1_title_button">
									        <img src="{img:00040303}" border="0" /> </a>
							        </td>
							        <!-- Next Year -->
							        <td>
								        <a href="javascript: void {var:this}.goTo(12);" class="eo_calendar_style1_title_button">
									        <img src="{img:00040304}" border="0" /> </a>
							        </td>
						        </tr>
					        </table>
				        </TitleTemplate>
				        <SelectedDayStyle CssText="background-color:White;border-bottom-color:Black;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Black;border-left-style:solid;border-left-width:1px;border-right-color:Black;border-right-style:solid;border-right-width:1px;border-top-color:Black;border-top-style:solid;border-top-width:1px;"></SelectedDayStyle>
				        <DisabledDayStyle CssText="border-bottom-color:#CFD9C0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#CFD9C0;border-left-style:solid;border-left-width:1px;border-right-color:#CFD9C0;border-right-style:solid;border-right-width:1px;border-top-color:#CFD9C0;border-top-style:solid;border-top-width:1px;color:gray;"></DisabledDayStyle>
				        <CalendarStyle CssText="border-right: #555566 1px solid; border-top: #555566 1px solid; border-left: #555566 1px solid; border-bottom: #555566 1px solid; background-color: #ebe9ed"></CalendarStyle>
				        <DayHoverStyle CssText="border-right: #bbbbbb 1px solid; border-top: #bbbbbb 1px solid; border-left: #bbbbbb 1px solid; border-bottom: #bbbbbb 1px solid; background-color: #ddeeff"></DayHoverStyle>
				        <MonthStyle CssText="font-size: 8pt; cursor: hand; font-family: verdana; background-color: #cfd9c0"></MonthStyle>
				        <DayStyle CssText="border-bottom-color:#CFD9C0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#CFD9C0;border-left-style:solid;border-left-width:1px;border-right-color:#CFD9C0;border-right-style:solid;border-right-width:1px;border-top-color:#CFD9C0;border-top-style:solid;border-top-width:1px;"></DayStyle>
				        <DayHeaderStyle CssText="font-weight: bold; font-size: 11px; color: black; border-bottom: #555566 1px solid; font-family: verdana; background-color: #ae9c86"></DayHeaderStyle>
			        </eo:DatePicker>
                </div>
                <div class="datepicker_holder">
                    <label for="dp_endDate">Крайна дата:</label>
                    
                    <eo:DatePicker runat="server" id="dp_endDate" DayCellWidth="22" DayCellHeight="14"
				            DisableWeekendDays="True"  Width="100px">
				        <TitleTemplate>
					        <table width="100%" border="0" cellSpacing="0" cellPadding="0" style="background-color:#f3f3f3;font-size: 11px; font-family: verdana; ">
						        <tr>
							        <!-- Previous Year -->
							        <td>
								        <a href="javascript: void {var:this}.goTo(-12);" class="eo_calendar_style1_title_button">
									        <img src="{img:00040302}" border="0" /> </a>
							        </td>
							        <!-- Previous Month -->
							        <td>
								        <a href="javascript: void {var:this}.goTo(-1);" class="eo_calendar_style1_title_button">
									        <img src="{img:00040301}" border="0" /> </a>
							        </td>
							        <!-- Current Month -->
							        <td width="99%" align="center">
								        {var:visible_date:MMM - yy}
							        </td>
							        <!-- Next Month -->
							        <td>
								        <a href="javascript: void {var:this}.goTo(1);" class="eo_calendar_style1_title_button">
									        <img src="{img:00040303}" border="0" /> </a>
							        </td>
							        <!-- Next Year -->
							        <td>
								        <a href="javascript: void {var:this}.goTo(12);" class="eo_calendar_style1_title_button">
									        <img src="{img:00040304}" border="0" /> </a>
							        </td>
						        </tr>
					        </table>
				        </TitleTemplate>
				        <SelectedDayStyle CssText="background-color:White;border-bottom-color:Black;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Black;border-left-style:solid;border-left-width:1px;border-right-color:Black;border-right-style:solid;border-right-width:1px;border-top-color:Black;border-top-style:solid;border-top-width:1px;"></SelectedDayStyle>
				        <DisabledDayStyle CssText="border-bottom-color:#CFD9C0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#CFD9C0;border-left-style:solid;border-left-width:1px;border-right-color:#CFD9C0;border-right-style:solid;border-right-width:1px;border-top-color:#CFD9C0;border-top-style:solid;border-top-width:1px;color:gray;"></DisabledDayStyle>
				        <CalendarStyle CssText="border-right: #555566 1px solid; border-top: #555566 1px solid; border-left: #555566 1px solid; border-bottom: #555566 1px solid; background-color: #ebe9ed"></CalendarStyle>
				        <DayHoverStyle CssText="border-right: #bbbbbb 1px solid; border-top: #bbbbbb 1px solid; border-left: #bbbbbb 1px solid; border-bottom: #bbbbbb 1px solid; background-color: #ddeeff"></DayHoverStyle>
				        <MonthStyle CssText="font-size: 8pt; cursor: hand; font-family: verdana; background-color: #cfd9c0"></MonthStyle>
				        <DayStyle CssText="border-bottom-color:#CFD9C0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#CFD9C0;border-left-style:solid;border-left-width:1px;border-right-color:#CFD9C0;border-right-style:solid;border-right-width:1px;border-top-color:#CFD9C0;border-top-style:solid;border-top-width:1px;"></DayStyle>
				        <DayHeaderStyle CssText="font-weight: bold; font-size: 11px; color: black; border-bottom: #555566 1px solid; font-family: verdana; background-color: #ae9c86"></DayHeaderStyle>
			        </eo:DatePicker>--%>

                </div>
                <div>
                    <label for="tb_LectresPerWeek">Лекции на седмица:</label>
                    <asp:TextBox runat="server" ID="tb_lecturesPerWeek" CssClass="boxes" Enabled="false"></asp:TextBox>
                    <div id="lecNum_btns_holder">
                        <input type="button" id="btn_lect_up"/>
                        <input type="button" id="btn_lect_down"/>
                    </div>
                    <ajaxToolkit:NumericUpDownExtender ID="nud_LecturesPerWeek" runat="server"
                        TargetControlID="tb_lecturesPerWeek" 
                        Width="100"
                        TargetButtonDownID="btn_lect_down"
                        TargetButtonUpID="btn_lect_up"
                        Minimum="1"
                        Maximum="30"
                        />
                </div>
            </div>
        
        </div>
        <script>
            function Validate() {
                var validBgName = ValidateBGName();

                if (!validBgName) {
                    alert("Курсът трябва да има име на Български!");
                    return false;
                }

                var validAlias = ValidateAlias();
                if (!validAlias) {
                    alert("Курсът трябва да има Псевдоним!");
                    return false;
                }

                return true;
            }

            function ValidateBGName() {
                var bgName = $("#main_body_tc_courseName_tab_courseNameBG_tb_courseNameBG");

                if (bgName.val()) {
                    return true;
                }
                else {
                    return false;
                }
            }

            function ValidateAlias() {
                var tbAlias = $("#main_body_tb_courseAlias");

                if (tbAlias.is(":visible") == true) {
                    if (tbAlias.val()) {
                        return true;
                    }
                    else {
                        return false;
                    }
                }
                else {
                    return true;
                }
            }
        </script>
    </div>
    

</asp:Content>
